package com.gupao.edu.homework.niocommunicate;

import java.nio.ByteBuffer;

/**
 * @description：自定义Buffer类中包含读缓冲区和写缓冲区，用于注册通道时的附加对象
 * @author：huabin.lin@xhmh.com
 * @version：2018年11月04日 21:36
 */
public class NioBuffers {

    private ByteBuffer readBuffer;
    private ByteBuffer writeBuffer;

    public NioBuffers(int readCapacity, int writeCapacity) {
        super();
        this.readBuffer = ByteBuffer.allocate(readCapacity);
        this.writeBuffer = ByteBuffer.allocate(writeCapacity);
    }

    public ByteBuffer getReadBuffer() {
        return readBuffer;
    }

    public ByteBuffer getWriteBuffer() {
        return writeBuffer;
    }
}
